home *** CD-ROM | disk | FTP | other *** search
- class classes.shots.DeathFizzle
- {
- var x;
- var y;
- var id;
- var clip;
- var cMax;
- var cv;
- var speed;
- var xMov = 0;
- var yMov = 0;
- var xMovT = 0;
- var yMovT = 0;
- var c = 0;
- var yank = false;
- var power = 15;
- var Name = "deathFizzle";
- function DeathFizzle(px, py, pid)
- {
- this.x = px;
- this.y = py;
- this.id = pid;
- _root.d = _root.d + 1;
- this.clip = _root.attachMovie("deathFizzle","deathFizzle" + this.id + "Clip",_root.d);
- this.clip._x = this.x;
- this.clip._y = this.y;
- this.cMax = _root.randRange(150,250);
- this.cv = 1;
- this.speed = 4;
- this.speed *= _root.dif.speed;
- }
- function main()
- {
- this.c = this.c + 1;
- var _loc3_ = _root.getAngleRad(this.x,this.y);
- this.xMovT = Math.cos(_loc3_) * this.speed;
- this.yMovT = Math.sin(_loc3_) * this.speed;
- this.speed += 0.1;
- this.cv -= 0.02;
- if(this.cv < 0.1)
- {
- this.cv = 0.1;
- }
- if(this.clip.hitTest(_root[_root.char + "Clip"]))
- {
- _root[_root.char].hit(this.xMov,this.yMov,100,this.power);
- }
- if(this.x > 1050 || this.x < -50 || this.y > 650 || this.y < -50)
- {
- this.yank = true;
- }
- if(this.xMovT < this.xMov)
- {
- this.xMov -= this.cv;
- }
- else if(this.xMovT > this.xMov)
- {
- this.xMov += this.cv;
- }
- else
- {
- this.xMov = this.xMovT;
- }
- if(this.yMovT < this.yMov)
- {
- this.yMov -= this.cv;
- }
- else if(this.yMovT > this.yMov)
- {
- this.yMov += this.cv;
- }
- else
- {
- this.yMov = this.yMovT;
- }
- this.x += this.xMov;
- this.y += this.yMov;
- if(this.yank)
- {
- _root.removeEnemyShot("deathFizzle" + this.id);
- }
- this.clip._x = this.x;
- this.clip._y = this.y;
- }
- }
-